﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<System.Web.Mvc.TreeViewEntity>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	用户一览
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset>
        <legend>用户一览</legend>
        <div>
            <%Html.BeginForm(); %>
            <table width="100%">
                <tr>
                    <td align="center">请输入用户名:<input name="name" class="text100"/><input type="submit" value="查找"/></td>
                </tr>
            </table>
            <%Html.EndForm(); %>
        </div>
        <div>
            <%=Html.CreateTreeView(Model) %>
        </div>
    </fieldset>
</asp:Content>
 
<asp:Content ID="Content3" ContentPlaceHolderID="StyleAndScript" runat="server">
    <script type="text/javascript">
        var url = '<%=Url.Action("ChildView",new {id="!!"}) %>';
        var y = '<%=Request["y"] %>';
        $(document).ready(function () {
            $(".SurrogateNode").each(function () {
                var node = $(this);
                node.attr("style", "cursor:pointer;");
                node.click(function () {
                    var item = $(this);
                    var id = item.attr("value");
                    var scroolY = window.scrollY;
                    window.location.href = url.replace('!!', id)+'?y='+scroolY;
                });
            });
            try{
                window.scrollTo(0,parseInt(y));
            }catch(e){}
        });
    </script>
    <style type="text/css">
        .SurrogateNode{ color:Blue;}
        .treeViewComm{ width:130px;}
    </style>
</asp:Content>
